import request from '@/utils/request'

// 查询客户分群定义信息列表
export function listGroupDefinition(query) {
  return request({
    url: '/prod-api/customer/groupDefinition/list',
    method: 'get',
    params: query
  })
}

// 查询客户分群定义信息详细
export function getGroupDefinition(definitionUid) {
  return request({
    url: '/prod-api/customer/groupDefinition/' + definitionUid,
    method: 'get'
  })
}

// 新增客户分群定义信息
export function addGroupDefinition(data) {
  return request({
    url: '/prod-api/customer/groupDefinition',
    method: 'post',
    data: data
  })
}

// 修改客户分群定义信息
export function updateGroupDefinition(data) {
  return request({
    url: '/prod-api/customer/groupDefinition',
    method: 'put',
    data: data
  })
}

// 删除客户分群定义信息
export function delGroupDefinition(definitionUid) {
  return request({
    url: '/prod-api/customer/groupDefinition/' + definitionUid,
    method: 'delete'
  })
}
// 修改客户分群特征状态
export function updateGroupDefinitionStatus(definitionUid,dataStatus){
  const data = {
    definitionUid,
    dataStatus
  }
  return request({
    url: '/prod-api/customer/groupDefinition/updateGroupDefinitionStatus',
    method: 'put',
    data: data
  })
}

export function getAllDefinitionInfo() {
  return request({
    url: '/prod-api/customer/groupDefinition/getAllDefinitionInfo',
    method: 'get'
  })
}